package leetcode.bfs;

import leetcode.bfs.common.BFSUtils;
import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 * int val;
 * TreeNode left;
 * TreeNode right;
 * TreeNode() {}
 * TreeNode(int val) { this.val = val; }
 * TreeNode(int val, TreeNode left, TreeNode right) {
 * this.val = val;
 * this.left = left;
 * this.right = right;
 * }
 * }
 */
class Solution783 {
    public int minDiffInBST(TreeNode root) {
        return BFSUtils.minDiffInBST(root);
    }
}

public class leetcode783 {
    public static void main(String[] args) {
        Solution783 solution783 = new Solution783();
        Integer[] nums = {4, 2, 6, 1, 3};
        Integer[] nums1 = {1, 0, 48, null, null, 12, 49};
        Integer[] nums2 = {90, 69, null, 49, 89, null, 52};
        System.out.println(solution783.minDiffInBST(TreeUtils.generateLeetcodeTree(nums)));
        System.out.println(solution783.minDiffInBST(TreeUtils.generateLeetcodeTree(nums1)));
        System.out.println(solution783.minDiffInBST(TreeUtils.generateLeetcodeTree(nums2)));
    }
}
